package com.medicalO2O.controller;

import com.medicalO2O.po.Doctor;
import com.medicalO2O.service.serviceimpl.UserServiceImpl;
import com.medicalO2O.utils.DoctorServiceUtils;
import com.sun.org.apache.xpath.internal.operations.Mod;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.Map;

/**
 * Created by Kevin on 2015/12/30.
 */
@Controller
public class UserController {
    @Autowired
    private UserServiceImpl userService;

    @RequestMapping("/user")
    public String doctorAttenance(ModelMap modelMap){
        Map<String ,LinkedHashMap<String,Map<String,Map<String,Map<String,String>>>>> doctorMap=userService.findDoctor("2015-12-15");
        LinkedList<String> weekList = DoctorServiceUtils.weekList("2015-12-15");
        modelMap.addAttribute("doctorMap",doctorMap);
        modelMap.addAttribute("weekList",weekList);
        return "index";
    }
}
